import 'package:cached_network_image/cached_network_image.dart';
import 'package:du_application/model/GoodsModel.dart';
import 'package:flutter/material.dart';

class DetailShow extends StatelessWidget {
  final AffairShow affairShow;
  const DetailShow({Key key,this.affairShow}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: <Widget>[
                      Container(
                  child: Container(
                    padding: EdgeInsets.symmetric(horizontal: 10),
                    margin: EdgeInsets.only(top: 5),
                    height: 50,
                    color: Colors.white,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: <Widget>[
                        Text("穿搭精选",
                            style: TextStyle(
                                color: Colors.grey[600], fontSize: 12)),
                        Row(
                          children: <Widget>[
                            Text("全部",
                                style: TextStyle(
                                    color: Colors.grey[600], fontSize: 12)),
                            Icon(
                              Icons.arrow_forward_ios,
                              color: Colors.grey[200],
                              size: 10,
                            ),
                          ],
                        ),
                      ],
                    ),
                  ),
                ),
              affairShow!=null&&affairShow.affairs.length>0?  GridView.count(
                  children: affairShow.affairs.map((item){
                   return InkWell(
                      child: CachedNetworkImage( imageUrl:item.affair.url,
                               fit:BoxFit.fill,
                             placeholder: (context, url) =>
                                 Image.asset('assets/loading.jpg',fit:BoxFit.fitWidth,)
                    ),
                           // print("111");
                         );



                  }).toList(),
                
           
             
               
            
                  //横轴元素个数
                  crossAxisCount: 3,
                  //纵轴间距
                  mainAxisSpacing: 1,
                  //横轴间距
                  crossAxisSpacing: 1,
                  //子组件宽高长度比例
                  physics: new NeverScrollableScrollPhysics(), //增加
                  shrinkWrap: true,
                ):Container(),
                Container(
                  padding: EdgeInsets.symmetric(vertical: 10),
                  color: Colors.white,
                  child: Container(
                      padding:
                          EdgeInsets.symmetric(horizontal: 10, vertical: 5),
                      margin: EdgeInsets.symmetric(horizontal: 20),
                      decoration: BoxDecoration(
                          border: Border.all(width: 1, color: Colors.black)),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: <Widget>[
                          Icon(Icons.camera),
                          Text("添加图片，晒出你的穿搭")
                        ],
                      )),
                )
        ],
      ),
    );
  }
}